home *** CD-ROM | disk | FTP | other *** search
/ Merciful 2 / Merciful - Disc 2.iso / software / x / xdmv1.3.lha / xdm / xDM13 < prev    next >
Text File  |  1995-07-20  |  3KB  |  148 lines

  1. .bra {
  2. .ket }
  3.  
  4. ; $VER: xDM v1.3 (20.7.95)
  5.             
  6. Cd >ENV:origcd
  7.  
  8. If NOT EXISTS LZX
  9.    If NOT EXISTS C:LZX
  10.    Echo "LZX tool not installed... exiting"
  11.    Skip getout
  12.    EndIf
  13. EndIf
  14.  
  15. If NOT EXISTS dd
  16.    Echo "dd tool not installed... exiting"
  17.    Skip getout
  18. EndIf
  19.  
  20. If NOT EXISTS PackDev
  21.    Echo "PackDev tool not installed... exiting"
  22.    Skip getout
  23. EndIf
  24.  
  25. If NOT EXISTS ENV:xdm
  26.    If NOT EXISTS ENVARC:xdm
  27.       Echo >ENV:xdm "T:" NOLINE
  28.    Else
  29.       Copy >NIL: ENVARC:xdm TO ENV:
  30.    EndIf
  31. EndIf
  32.  
  33. LAB begin
  34. RequestChoice >ENV:xdmaction "xDM" "Select Action" "Compress" "Decompress" "QUIT"
  35.  
  36. If $xdmaction EQ "0"
  37.    Skip getout
  38. EndIf
  39.  
  40. LAB startpack
  41. RequestChoice >ENV:xdmdev "xDM" "Select Device" "DF0:" "DF1:" "DF2:" "DF3:" "RAD:" "BACK"
  42.  
  43. If $xdmdev EQ "0"
  44.    Skip cleanup
  45. EndIf
  46.  
  47. Eval >ENV:xdmdrvdef $xdmdev - 1
  48. Echo >ENV:xdmdrive "DF$xdmdrvdef:"
  49.  
  50. If $xdmdev EQ "5"
  51.    If NOT EXISTS RAD:
  52.       Echo "Mounting RAD and restarting..."
  53.       Mount RAD
  54.       Skip cleanup            
  55.    EndIf
  56.    Echo >ENV:xdmdrive "RAD:"
  57. Endif
  58.  
  59. If $xdmaction EQ "1"
  60.    Skip compress
  61. EndIf
  62.  
  63. If $xdmaction EQ "2"
  64.    Skip decompress
  65. EndIf
  66.  
  67. LAB compress
  68. RequestFile >ENV:xdmdest DRAWER $xdm FILE ".xdm" PATTERN "#?.xdm" TITLE "Select Destination File" NOICONS
  69.  
  70. If WARN
  71.    Skip cleanup
  72. EndIf
  73.  
  74. RequestChoice >ENV:xdmall "xDM" "Is the disk using any alien filesystem? (see docs)" "YES" "NO" "RESTART"
  75.  
  76. If $xdmall EQ "0" 
  77.    Skip cleanup
  78. EndIf
  79.  
  80. If $xdmall EQ "1"
  81.    Echo >ENV:xdmall "ALL"
  82. EndIf
  83.  
  84. If $xdmall EQ "2"
  85.    Echo >ENV:xdmall 
  86. EndIf
  87.  
  88. Echo " xDM - ©1995 Adam Chapman & Dirk Vael"
  89. Echo "Creating disk image... Please wait!"
  90. Cd $xdm
  91. PackDev $xdmdrive xDM NC Q $xdmall
  92.  
  93. If ERROR
  94.    Echo "Sorry, some error has occured... Make sure all needed files and disks are present."
  95.    Skip cleanup
  96. EndIf
  97.  
  98. Echo "Archiving image... Please wait!"
  99. Cd $xdm
  100. LZX -3 -X0 -U0 -M1024 a $xdmdest xDM.pkd 
  101. List $xdmdest LFormat %L >ENV:size
  102. Echo "The disk was mashed into an archive of $size bytes!"
  103. Skip cleanup
  104.  
  105. LAB decompress
  106. RequestFile >ENV:xdmdest DRAWER $xdm FILE ".xdm" PATTERN "#?.xdm" TITLE "Select Archive" NOICONS
  107.  
  108. If WARN
  109.    Skip cleanup
  110. EndIf
  111.  
  112. Echo " xDM - ©1995 Adam Chapman & Dirk Vael"
  113. Echo "Decompressing image... Please wait!"
  114. LZX -X0 x $xdmdest $xdm
  115. Echo "Recreating disk image... Please wait!"
  116. Cd $xdm
  117. PackDev xDM.pkd $xdmdrive NC Q ETDF
  118.  
  119. If ERROR
  120.    Echo "Disk image (probably) created with xDM V1.0-V1.2"
  121.    Echo "xDM is now trying the old routines to restore... Hold on!"
  122.    dd -c1760 -w$xdmdrive xDM.dsk 
  123.    If ERROR
  124.     Echo "Sorry, some weird error has occured... Check docs for troubleshooting!"
  125.     Skip cleanup
  126.    EndIf
  127. EndIf
  128.  
  129. Echo "Process complete!"
  130. DiskChange $xdmdrive
  131.  
  132. LAB cleanup
  133. Cd $xdm
  134. Delete >NIL: xDM.pkd
  135. Delete >NIL: xDM.dsk
  136. Cd ENV:
  137. Delete >NIL: xdmdev xdmall xdmdrvdef xdmdrive xdmdest xdmaction
  138. Skip begin BACK
  139.  
  140. LAB getout
  141. Cd $xdm
  142. Delete >NIL: xDM.pkd
  143. Delete >NIL: xDM.dsk
  144. Cd ENV:
  145. Delete >NIL: size xdmall xdmdev xdmdrvdef xdmdrive xdmdest xdmaction
  146. Cd "$origcd"
  147. Delete >NIL: ENV:origcd
  148.